package com.google.android.apps.skipbot;

public enum IKSequenceConfig implements IKSequenceProvider {

  RIPPLE_GAIT(18, // Number of frames
      -1, // Number of cycles
      25, // Frame pause in ms
      new double[][] { // The relative position in inches of the foot at each
                       // frame.
      {1.5, 0}, // 0
          {1.3, 0}, // 1
          {1.1, 0}, // 2
          {0.9, 0}, // 3
          {0.7, 0}, // 4
          {0.5, 0}, // 5
          {0.3, 0}, // 6
          {0.1, 0}, // 7
          {-0.1, 0}, // 8
          {-0.3, 0}, // 9
          {-0.5, 0}, // 10
          {-0.7, 0}, // 11
          {-0.9, 0}, // 12
          {-1.1, 0}, // 13
          {-1.3, 0}, // 14
          {-1.5, 0}, // 15
          {-0.9, 1.6}, // 16
          {1.1, 1.8} // 17
      },
      // Traditional ripple gait starting sequence.
      // new int[]{ 0, 3, 6, 9, 12, 15 },
      new int[] {15, 9, 3, 12, 6, 0}, // Staggered ripple gait starting
                                      // sequence.
      new double[][] { // Leg base position
      {3.5, 6.062, -2.5}, // Leg 0
          {7, 0, -2.5}, // Leg 1
          {3.5, -6.062, -2.5}, // Leg 2
          {-3.5, -6.062, -2.5}, // Leg 3
          {-7, 0, -2.5}, // Leg 4
          {-3.5, 6.062, -2.5}, // Leg 5
      }), TRIPOD_GAIT(6, -1, 250, new double[][] { {1.5, 0}, // 0
      {0.5, 0}, // 1
      {-0.5, 0}, // 2
      {-1.5, 0}, // 3
      {-0.9, 1.6}, // 4
      {1.1, 1.8} // 5
      }, new int[] {0, 3, 0, 3, 0, 3}, new double[][] { {3.5, 6.062, -2.5}, // Leg
                                                                            // 0
          {7.0, 0.0, -2.5}, // Leg 1
          {3.5, -6.062, -2.5}, // Leg 2
          {-3.5, -6.062, -2.5}, // Leg 3
          {-7.0, 0.0, -2.5}, // Leg 4
          {-3.6, 6.062, -2.5}, // Leg 5
      }), STAGGER_GAIT(12, -1, 25, new double[][] { // The relative position in
                                                    // inches of the foot at
                                                    // each frame.
      {1.5, 0}, // 0
          {1.167, 0}, // 1
          {0.833, 0}, // 2
          {0.5, 0}, // 3
          {0.167, 0}, // 4
          {-0.167, 0}, // 5
          {-0.5, 0}, // 6
          {-0.833, 0}, // 7
          {-1.167, 0}, // 8
          {-1.5, 0}, // 9
          {-0.9, 1.6}, // 10
          {1.1, 1.8} // 11
      }, new int[] {11, 7, 3, 9, 5, 1}, new double[][] { // Leg base position
      {3.5, 6.062, -2.5}, // Leg 0
          {7, 0, -2.5}, // Leg 1
          {3.5, -6.062, -2.5}, // Leg 2
          {-3.5, -6.062, -2.5}, // Leg 3
          {-7, 0, -2.5}, // Leg 4
          {-3.5, 6.062, -2.5}, // Leg 5
      }), RIPPLE_GAIT_SMALL(18, // Number of frames
      -1, // Number of cycles
      25, // Frame pause in ms
      new double[][] { // The relative position in inches of the foot at each
                       // frame.
      {.939, 0}, // 0
          {.814, 0}, // 1
          {.689, 0}, // 2
          {.563, 0}, // 3
          {.438, 0}, // 4
          {.313, 0}, // 5
          {.188, 0}, // 6
          {.063, 0}, // 7
          {-.063, 0}, // 8
          {-.188, 0}, // 9
          {-.313, 0}, // 10
          {-.438, 0}, // 11
          {-.563, 0}, // 12
          {-.689, 0}, // 13
          {-.814, 0}, // 14
          {-.939, 0}, // 15
          {-0.563, 1.00}, // 16
          {.689, 1.127} // 17
      },
      // Traditional ripple gait starting sequence.
      // new int[]{ 0, 3, 6, 9, 12, 15 },
      new int[] {15, 9, 3, 12, 6, 0}, // Staggered ripple gait starting
                                      // sequence.
      new double[][] { // Leg base position
      {2.191, 3.795, -1.565}, // Leg 0
          {4.382, 0, -1.565}, // Leg 1
          {2.191, -3.795, -1.565}, // Leg 2
          {-2.191, -3.795, -1.565}, // Leg 3
          {-4.382, 0, -1.565}, // Leg 4
          {-2.191, 3.795, -1.565}, // Leg 5
      }), TRIPOD_GAIT_SMALL(6, -1, 250, new double[][] { {1.5 * .626, 0}, // 0
      {0.5 * .626, 0}, // 1
      {-0.5 * .626, 0}, // 2
      {-1.5 * .626, 0}, // 3
      {-0.9 * .626, 1.6 * .626}, // 4
      {1.1 * .626, 1.8 * .626} // 5
      }, new int[] {0, 3, 0, 3, 0, 3}, new double[][] { {2.191, 3.795, -1.565}, // Leg
                                                                                // 0
          {4.382, 0, -1.565}, // Leg 1
          {2.191, -3.795, -1.565}, // Leg 2
          {-2.191, -3.795, -1.565}, // Leg 3
          {-4.382, 0, -1.565}, // Leg 4
          {-2.191, 3.795, -1.565}, // Leg 5
      }), STAGGER_GAIT_SMALL(12, -1, 25, new double[][] { // The relative
                                                          // position in inches
                                                          // of the foot at each
                                                          // frame.
      {1.5 * .626, 0}, // 0
          {1.167 * .626, 0}, // 1
          {0.833 * .626, 0}, // 2
          {0.5 * .626, 0}, // 3
          {0.167 * .626, 0}, // 4
          {-0.167 * .626, 0}, // 5
          {-0.5 * .626, 0}, // 6
          {-0.833 * .626, 0}, // 7
          {-1.167 * .626, 0}, // 8
          {-1.5 * .626, 0}, // 9
          {-0.9 * .626, 1.6 * .626}, // 10
          {1.1 * .626, 1.8 * .626} // 11
      }, new int[] {11, 7, 3, 9, 5, 1}, new double[][] { // Leg base position
      {2.191, 3.795, -1.565}, // Leg 0
          {4.382, 0, -1.565}, // Leg 1
          {2.191, -3.795, -1.565}, // Leg 2
          {-2.191, -3.795, -1.565}, // Leg 3
          {-4.382, 0, -1.565}, // Leg 4
          {-2.191, 3.795, -1.565}, // Leg 5
      });

  private final int numberOfFrames;
  private final int numberOfCycles;
  private final int framePause;

  // The relative position in inches of the foot at each frame.
  private final double[][] stridePosition;
  private final int[] initialLegStridePosition;
  private final double[][] legBasePosition;

  @Override
  public int getNumberOfFrames() {
    return numberOfFrames;
  }

  @Override
  public int getNumberOfCycles() {
    return numberOfCycles;
  }

  @Override
  public int getFramePause() {
    return framePause;
  }

  @Override
  public double[][] getStridePosition() {
    return stridePosition;
  }

  @Override
  public int[] getInitialLegStridePosition() {
    return initialLegStridePosition;
  }

  @Override
  public double[][] getLegBasePosition() {
    return legBasePosition;
  }

  private IKSequenceConfig(int numberOfFrames, int numberOfCycles, int framePause,
      double[][] stridePosition, int[] initialLegStridePosition, double[][] legBasePosition) {
    this.numberOfFrames = numberOfFrames;
    this.numberOfCycles = numberOfCycles;
    this.framePause = framePause;
    this.stridePosition = stridePosition;
    this.initialLegStridePosition = initialLegStridePosition;
    this.legBasePosition = legBasePosition;
  };



}
